#pragma once

#include <glm/glm.hpp>
#include <teflon/gapi/texture2d.h>

namespace teflon
{
    struct SpriteVertex
    {
        glm::vec2 pos = glm::vec2(0.0f);
        glm::vec4 color = glm::vec4(0.0f);
        glm::vec2 uv = glm::vec2(0.0f);
        float texture_slot = -1.0f;
    };

    struct Sprite
    {
        glm::vec2 pos = glm::vec2(0.0f, 0.f);
        glm::vec2 size = glm::vec2(0.f, 0.f);

        virtual void Update() {}
        virtual uint32_t NumIndices() const = 0;
        virtual uint32_t NumVertices() const = 0;
    };

    // simple flat 2d rectangle.
    struct ColoredQuad : public Sprite
    {
        glm::vec4 color = glm::vec4(0.f, 0.f, 0.f, 0.f);

        ColoredQuad() {}
        ColoredQuad(glm::vec2 pos, glm::vec2 size, glm::vec4 color);
        
        uint32_t NumIndices() const { return 6; }
        uint32_t NumVertices() const { return 4; }
    };

    struct SpriteQuad : public Sprite
    {
        glm::vec4 uvs = glm::vec4(0.f, 0.f, 1.f, 1.f);
        std::shared_ptr<Texture2D> texture;

        SpriteQuad() {}
        SpriteQuad(glm::vec2& pos, glm::vec2& size, const std::string& image_path);
        
        uint32_t NumIndices() const { return 6; }
        uint32_t NumVertices() const { return 4; }
    };
}
